#include "DCUtils.h"

void DCUtils::draw(wxDC *dc, const wxPoints *points, wxRect *rect)
{
    dc->SetPen(*wxBLACK_PEN);

    wxCoord centerX = (int)(rect->width / 2.), centerY = (int)(rect->height / 2.);
    dc->DrawLine(wxPoint(0, centerY), wxPoint(rect->width, centerY));
    dc->DrawLine(wxPoint(centerX, 0), wxPoint(centerX, rect->height));

    int length = points->count();

    if(length > 0)
    {
        dc->SetPen(*wxBLUE_PEN);
        for(int i = 0; i < length; i++)
        {
            dc->DrawPoint(wxPoint(centerX + points->getPoint(i)->x, centerY - points->getPoint(i)->y));
        }
    }
}
